﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace CDCOSDH
{
    public partial class JournalizeMulti : Form
    {

        private string mailRightSelected = string.Empty;
        private string freeCatsSeleected = string.Empty;
        private string casePartsSelected = string.Empty;
        private string caseParts = string.Empty;

        public JournalizeMulti()
        {
            InitializeComponent();
        }

        private void JournalizeMulti_Load(object sender, EventArgs e)
        {
            this.cbSDH.DataSource = ConvergensDominoConnector.DominoConnector.Default.FindSDHDBS();
            this.setLastSelectedSDH();

            this.cbCaseOfr.DataSource = ConvergensDominoConnector.DominoConnector.Default.LoadCaseOfficers();
            this.cbCaseOfr.SelectedItem = ConvergensDominoConnector.DominoConnector.Default.CommonName;
            this.cbRplyReq.SelectedIndex = 1;
            this.lblSDHname.Text = this.cbSDH.Text;
            this.btnCaseParts.Visible = false;
        }

        private void btnMailRights_Click(object sender, EventArgs e)
        {
            using (FrmListbox fListBox = new FrmListbox("hvem må se e-mailen i SDH", this.mailRightSelected.Split(';')))
            {
                this.mailRightSelected = string.Empty;

                if (fListBox.ShowDialog(this) == DialogResult.OK)
                {
                    for (int i = 0; i < fListBox.listView.CheckedItems.Count; i++)
                    {
                        if (i == 0)
                        {
                            this.mailRightSelected = fListBox.listView.CheckedItems[i].Text;
                        }
                        else
                        {
                            this.mailRightSelected = this.mailRightSelected + ";" + fListBox.listView.CheckedItems[i].Text;
                        }
                    }

                    this.setMailRightsTpTxt(this.mailRightSelected);
                }
            }
        }

        private void btnFndCaseNum_Click(object sender, EventArgs e)
        {
            using (FindCaseNum findCaseNum = new FindCaseNum(this.cbSDH.SelectedItem.ToString()))
            {
                if (findCaseNum.ShowDialog(this) == DialogResult.OK)
                {
                    this.lbCaseArea.Text = string.Empty;
                    this.lbInstitution.Text = string.Empty;
                    this.lbEdction.Text = string.Empty;
                    this.lbLeglAspcts.Text = string.Empty;
                    this.lbEcoAspcts.Text = string.Empty;
                    this.lbtitle.Text = string.Empty;

                    this.casePartsSelected = string.Empty;
                    this.caseParts = string.Empty;
                    this.lbCasePartsSelected.Text = string.Empty;

                    string readers = string.Empty;

                    this.tbCaseNumTxt = findCaseNum.selectedRow[0].ToString();
                    this.lbCaseSubjectTxt = findCaseNum.selectedRow[1].ToString();
                    this.lbtitle.Text = findCaseNum.selectedRow[1].ToString();

                    List<Array> variant1Emneord = ConvergensDominoConnector.DominoConnector.Default.GetVariant1Emneord(this.cbSDH.Text, findCaseNum.selectedRow[2].ToString());

                    Array temp0 = variant1Emneord[0];
                    Array temp1 = variant1Emneord[1];
                    Array temp2 = variant1Emneord[2];
                    Array temp3 = variant1Emneord[3];
                    Array temp4 = variant1Emneord[4];
                    Array temp5 = variant1Emneord[7];
                    Array temp6 = variant1Emneord[8];

                    if (!this.tbCaseNumTxt.Equals(string.Empty))
                    {
                        this.btnCaseParts.Visible = true;

                        for (int i = 0; i < temp6.Length; i++)
                        {
                            if (i == 0)
                            {
                                this.caseParts += (string)temp6.GetValue(i);

                            }
                            else
                            {
                                this.caseParts += ";" + (string)temp6.GetValue(i);
                            }
                        }
                    }

                    this.lbtitle.Text = (string)variant1Emneord[5].GetValue(0);

                    #region // if protected
                    string caseprotected = (string)variant1Emneord[6].GetValue(0);

                    if (caseprotected.Equals("1"))
                    {
                        this.btnMailRights.Visible = false;

                        for (int i = 0; i < temp5.Length; i++)
                        {
                            if (i == 0)
                            {
                                readers += (string)temp5.GetValue(i);

                            }
                            else
                            {
                                readers += ";" + (string)temp5.GetValue(i);
                            }
                        }

                        this.setMailRightsTpTxt(readers);
                    }
                    else
                    {
                        this.btnMailRights.Visible = true;
                        this.setMailRightsTpTxt((string)variant1Emneord[7].GetValue(0));
                        //JAS Her kunne "hvem må se"-valglisten også sættes til "UVM" (som er default på sagen), men det er fint den ikke er på.
                    }
                    #endregion

                    for (int i = 0; i < temp0.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbCaseArea.Text += (string)temp0.GetValue(i);

                        }
                        else
                        {
                            this.lbCaseArea.Text += ";" + (string)temp0.GetValue(i);
                        }
                    }


                    for (int i = 0; i < temp1.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbEdction.Text += (string)temp1.GetValue(i);

                        }
                        else
                        {
                            this.lbEdction.Text += ";" + (string)temp1.GetValue(i);
                        }
                    }

                    for (int i = 0; i < temp2.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbInstitution.Text += (string)temp2.GetValue(i);

                        }
                        else
                        {
                            this.lbInstitution.Text += ";" + (string)temp2.GetValue(i);
                        }
                    }


                    for (int i = 0; i < temp3.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbLeglAspcts.Text += (string)temp3.GetValue(i);

                        }
                        else
                        {
                            this.lbLeglAspcts.Text += ";" + (string)temp3.GetValue(i);
                        }
                    }

                    for (int i = 0; i < temp4.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbEcoAspcts.Text += (string)temp4.GetValue(i);

                        }
                        else
                        {
                            this.lbEcoAspcts.Text += ";" + (string)temp4.GetValue(i);
                        }
                    }

                    temp0 = null;
                    temp1 = null;
                    temp2 = null;
                    temp3 = null;
                    temp4 = null;
                    temp5 = null;
                    temp6 = null;

                    this.setCaseAreaTpTxt();
                    this.setEdctionTpTxt();
                    this.setInstitutionTpTxt();
                    this.setLeglAspctsTpTxt();
                    this.setEcoAspctsTpTxt();
                }
            }
        }

        private void setFreeCatsTpTxt(string freeCatsSelected)
        {
            string toolTipText = freeCatsSelected;

            this.lbFreeCatsSelected.Text = freeCatsSelected;

            if (freeCatsSelected.Length > 55)
            {
                this.btnExpandFreeCats.Visible = true;
                this.lbFreeCatsSelected.Text = this.lbFreeCatsSelected.Text.Substring(0, 55);
                this.tpFreeCats.SetToolTip(this.btnExpandFreeCats, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandFreeCats.Visible = false;
                this.tpFreeCats.SetToolTip(this.btnExpandFreeCats, toolTipText);
            }

        }

        private void setMailRightsTpTxt(string mailRightSelected)
        {
            string toolTipText = mailRightSelected;

            this.lbMailRightSelected.Text = mailRightSelected;

            if (mailRightSelected.Length > 55)
            {
                this.btnExpandMailRights.Visible = true;
                this.lbMailRightSelected.Text = this.lbMailRightSelected.Text.Substring(0, 55);
                this.tpMailRights.SetToolTip(this.btnExpandMailRights, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandMailRights.Visible = false;
                this.tpMailRights.SetToolTip(this.btnExpandMailRights, toolTipText);
            }

        }

        private void setCaseAreaTpTxt()
        {
            string toolTipText = this.lbCaseArea.Text;

            if (this.lbCaseArea.Text.Length > 75)
            {
                this.btnExpandCaseArea.Visible = true;
                this.tpCaseArea.SetToolTip(this.btnExpandCaseArea, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandCaseArea.Visible = false;
                this.tpCaseArea.SetToolTip(this.btnExpandCaseArea, toolTipText);
            }
        }

        private void setEdctionTpTxt()
        {
            string toolTipText = this.lbEdction.Text;

            if (this.lbEdction.Text.Length > 75)
            {
                this.btnExpandEdction.Visible = true;
                this.tpEdction.SetToolTip(this.btnExpandEdction, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandEdction.Visible = false;
                this.tpEdction.SetToolTip(this.btnExpandEdction, toolTipText);
            }

        }

        private void setInstitutionTpTxt()
        {
            string toolTipText = this.lbInstitution.Text;

            if (this.lbInstitution.Text.Length > 75)
            {
                this.btnExpandInstitution.Visible = true;
                this.tpInstitution.SetToolTip(this.btnExpandInstitution, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandInstitution.Visible = false;
                this.tpInstitution.SetToolTip(this.btnExpandInstitution, toolTipText);
            }

        }

        private void setLeglAspctsTpTxt()
        {
            string toolTipText = this.lbLeglAspcts.Text;

            if (this.lbLeglAspcts.Text.Length > 75)
            {
                this.btnExpandLeglAspcts.Visible = true;
                this.tpLeglAspcts.SetToolTip(this.btnExpandLeglAspcts, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandLeglAspcts.Visible = false;
                this.tpLeglAspcts.SetToolTip(this.btnExpandLeglAspcts, toolTipText);
            }

        }

        private void setEcoAspctsTpTxt()
        {
            string toolTipText = this.lbEcoAspcts.Text;

            if (this.lbEcoAspcts.Text.Length > 75)
            {
                this.btnExpandEcoAspcts.Visible = true;
                this.tpEcoAspcts.SetToolTip(this.btnExpandEcoAspcts, toolTipText.Replace(";", Environment.NewLine));
            }
            else
            {
                this.btnExpandEcoAspcts.Visible = false;
                this.tpEcoAspcts.SetToolTip(this.btnExpandEcoAspcts, toolTipText);
            }
        }

        private void setLastSelectedSDH()
        {
            try
            {

                //Select the RegistryHive you wish to read from 
                RegistryKey key = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");

                //Select the path within the hive 
                RegistryKey subkey = key.OpenSubKey("Software\\Convergens\\CDCOSDH");

                if (subkey != null)
                {
                    //Read the key 
                    this.cbSDH.SelectedItem = subkey.GetValue("LastCbSDHDB");
                }

                //RegistryKey registryKey = OpenRegistryKey();
                //if (Application.UserAppDataRegistry.GetValue("LastCbSDHDb") != null)
                //{
                //    object objLastCbSDHDB = registryKey.GetValue("LastCbSDHDB");
                //    if (objLastCbSDHDB != null)
                //    {
                //        RegistryValueKind lastCbSDHDbValueKind = registryKey.GetValueKind("LastCbSDHDB");
                //        switch (lastCbSDHDbValueKind)
                //        {
                //            case RegistryValueKind.DWord:
                //                break;
                //            case RegistryValueKind.Binary:
                //                break;
                //            case RegistryValueKind.ExpandString:
                //                this.cbSDH.SelectedItem = (string)objLastCbSDHDB;
                //                break;
                //            case RegistryValueKind.MultiString:
                //                this.cbSDH.SelectedItem = (string)objLastCbSDHDB;
                //                break;
                //            case RegistryValueKind.QWord:
                //                break;
                //            case RegistryValueKind.String:
                //                this.cbSDH.SelectedItem = (string)objLastCbSDHDB;
                //                break;
                //            case RegistryValueKind.Unknown:
                //            default:
                //                break;
                //        }
                //    }
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        #region getters and setters
        public string tbCaseNumTxt
        {
            get { return this.tbCaseNum.Text; }
            set { tbCaseNum.Text = value; }
        }

        public string lbCaseSubjectTxt
        {
            get { return this.lbtitle.Text; }
            set { lbtitle.Text = value; }
        }

        public string cbSDHTxt
        {
            get { return this.lblSDHname.Text; }
            set { lblSDHname.Text = value; }
        }

        public string cbRlpyReqTxt
        {
            get { return this.cbRplyReq.Text; }
            set { cbRplyReq.Text = value; }
        }

        public string cbCaseOfrTxt
        {
            get { return this.cbCaseOfr.Text; }
            set { cbCaseOfr.Text = value; }
        }

        public string MailRightSelectedTxt
        {
            get { return this.mailRightSelected; }
            set { mailRightSelected = value; }
        }

        public string FreeCatsSelectedTxt
        {
            get { return this.freeCatsSeleected; }
            set { freeCatsSeleected = value; }
        }

        public string tbRemarksTxt
        {
            get { return this.tbRemarks.Text; }
            set { tbRemarks.Text = value; }
        }

        public string lbCaseAreaTxt
        {
            get { return this.lbCaseArea.Text; }
            set { lbCaseArea.Text = value; }
        }

        public string lbEdctionTxt
        {
            get { return this.lbEdction.Text; }
            set { lbEdction.Text = value; }
        }

        public string lbInstitutionTxt
        {
            get { return this.lbInstitution.Text; }
            set { lbInstitution.Text = value; }
        }

        public string lbLeglAspctsTxt
        {
            get { return this.lbLeglAspcts.Text; }
            set { lbLeglAspcts.Text = value; }
        }

        public string lbEcoAspctsTxt
        {
            get { return this.lbEcoAspcts.Text; }
            set { lbEcoAspcts.Text = value; }
        }

        public bool cbOpenCaseValue
        {
            get { return this.cbOpenCase.Checked; }
            set { cbOpenCase.Checked = value; }
        }


        public string cbCasePartsTxt
        {
            get { return this.lbCasePartsSelected22.Text; }
            set { lbCasePartsSelected22.Text = value; }
        }

        public string lbFreeCatTxt
        {
            get { return this.lbFreeCatsSelected.Text; }
            set { lbFreeCatsSelected.Text = value; }
        }
        #endregion

        private void btnFreeCat_Click(object sender, EventArgs e)
        {
            using (FrmListbox fListBox = new FrmListbox("Frie kategorier", this.freeCatsSeleected.Split(';'), this.cbSDH.Text))
            {
                this.freeCatsSeleected = string.Empty;

                if (fListBox.ShowDialog(this) == DialogResult.OK)
                {
                    for (int i = 0; i < fListBox.listView.CheckedItems.Count; i++)
                    {
                        //if (this.lbMailRightSelected.Text.Length == 0)
                        //{
                        //    this.lbMailRightSelected.Text = fListBox.listView.CheckedItems[i].Text;
                        //}
                        if (i == 0)
                        {
                            this.freeCatsSeleected = fListBox.listView.CheckedItems[i].Text;
                        }
                        else
                        {
                            this.freeCatsSeleected = this.freeCatsSeleected + ";" + fListBox.listView.CheckedItems[i].Text;
                        }
                    }

                    this.setFreeCatsTpTxt(this.freeCatsSeleected);
                }
            }
        }

        private RegistryKey CreateRegistryKey()
        {
            RegistryKey registryKey = Registry.CurrentUser;
            if (registryKey == null)
            {
                throw new Exception("Failed to open current user registry key.");
            }
            registryKey = registryKey.CreateSubKey("Software");
            if (registryKey == null)
            {
                throw new Exception("Failed to create registry key. " + registryKey.ToString() + "/" + "Software");
            }
            registryKey = registryKey.CreateSubKey("Convergens");
            if (registryKey == null)
            {
                throw new Exception("Failed to create registry key. " + registryKey.ToString() + "/" + "Convergens");
            }
            registryKey = registryKey.CreateSubKey("CDCOSDH");
            if (registryKey == null)
            {
                throw new Exception("Failed to create registry key. " + registryKey.ToString() + "/" + "CDCOSDH");
            }
            return registryKey;
        }

        private RegistryKey OpenRegistryKey()
        {
            RegistryKey registryKey = Registry.CurrentUser;
            if (registryKey == null)
            {
                throw new Exception("Failed to open current user registry key.");
            }
            registryKey = registryKey.OpenSubKey("Software");
            if (registryKey == null)
            {
                throw new Exception("Failed to open registry key. " + registryKey.ToString() + "/" + "Software");
            }
            registryKey = registryKey.OpenSubKey("Convergens");
            if (registryKey == null)
            {
                throw new Exception("Failed to open registry key. " + registryKey.ToString() + "/" + "Convergens");
            }
            registryKey = registryKey.OpenSubKey("CDCOSDH");
            if (registryKey == null)
            {
                throw new Exception("Failed to open registry key. " + registryKey.ToString() + "/" + "CDCOSDH");
            }
            return registryKey;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            RegistryKey registryKey = CreateRegistryKey();

            try
            {
                registryKey.SetValue("LastCbSDHDb", this.cbSDH.Text, RegistryValueKind.String);
                registryKey.Flush();
                registryKey.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void JournalizeMulti_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                DialogResult result = MessageBox.Show("Vil du afbryde journaliseringen?", "Convergens Domino Connector for SDH", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);

                if (result == DialogResult.OK)
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
        }

        private void cbSDH_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.tbCaseNum.Text = string.Empty;
            this.lblSDHname.Text = this.cbSDH.Text;
        }

        private void btnCaseParts_Click(object sender, EventArgs e)
        {
            using (FrmListbox fListBox = new FrmListbox("Vælg Sagsdele", this.casePartsSelected.Split(';'), this.caseParts.Split(';'), this.cbSDH.Text))
            {

                if (fListBox.ShowDialog(this) == DialogResult.OK)
                {
                    this.casePartsSelected = string.Empty;

                    for (int i = 0; i < fListBox.listView.CheckedItems.Count; i++)
                    {
                        if (i == 0)
                        {
                            this.casePartsSelected = fListBox.listView.CheckedItems[i].Text;
                        }
                        else
                        {
                            this.casePartsSelected = this.casePartsSelected + ";" + fListBox.listView.CheckedItems[i].Text;
                        }
                    }

                    this.lbCasePartsSelected22.Text = casePartsSelected;

                    //this.setCasePartsTpTxt(this.casePartsSelected);
                }
            }
        }

        private void tbCaseNum_Leave(object sender, EventArgs e)
        {
            #region Fill stuff from typed case number
            try
            {
                //060.38P.231
                this.lbCaseArea.Text = string.Empty;
                this.lbEdction.Text = string.Empty;
                this.lbInstitution.Text = string.Empty;
                this.lbLeglAspcts.Text = string.Empty;
                this.lbEcoAspcts.Text = string.Empty;
                this.lbtitle.Text = string.Empty;

                this.casePartsSelected = string.Empty;
                this.caseParts = string.Empty;
                this.btnCaseParts.Visible = false;
                this.lbCasePartsSelected.Text = string.Empty;

                string readers = string.Empty;

                string caseDocUnid = ConvergensDominoConnector.DominoConnector.Default.GetSDHCaseDocumentUNIDByCaseNumber(this.tbCaseNum.Text, this.cbSDH.Text);

                if (caseDocUnid != string.Empty)
                {
                    this.btnCaseParts.Visible = true;

                    List<Array> variant1Emneord = ConvergensDominoConnector.DominoConnector.Default.GetVariant1Emneord(this.cbSDH.Text, caseDocUnid);

                    Array temp0 = variant1Emneord[0];
                    Array temp1 = variant1Emneord[1];
                    Array temp2 = variant1Emneord[2];
                    Array temp3 = variant1Emneord[3];
                    Array temp4 = variant1Emneord[4];
                    Array temp5 = variant1Emneord[7];
                    Array temp6 = variant1Emneord[8];


                    #region // if protected
                    string caseprotected = (string)variant1Emneord[6].GetValue(0);

                    if (caseprotected.Equals("1"))
                    {
                        this.btnMailRights.Visible = false;

                        for (int i = 0; i < temp5.Length; i++)
                        {
                            if (i == 0)
                            {
                                readers += (string)temp5.GetValue(i);

                            }
                            else
                            {
                                readers += ";" + (string)temp5.GetValue(i);
                            }
                        }

                        this.setMailRightsTpTxt(readers);
                    }
                    #endregion

                    this.lbtitle.Text = (string)variant1Emneord[5].GetValue(0);

                    for (int i = 0; i < temp0.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbCaseArea.Text += (string)temp0.GetValue(i);

                        }
                        else
                        {
                            this.lbCaseArea.Text += ";" + (string)temp0.GetValue(i);
                        }
                    }


                    for (int i = 0; i < temp1.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbEdction.Text += (string)temp1.GetValue(i);

                        }
                        else
                        {
                            this.lbEdction.Text += ";" + (string)temp1.GetValue(i);
                        }
                    }

                    for (int i = 0; i < temp2.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbInstitution.Text += (string)temp2.GetValue(i);

                        }
                        else
                        {
                            this.lbInstitution.Text += ";" + (string)temp2.GetValue(i);
                        }
                    }


                    for (int i = 0; i < temp3.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbLeglAspcts.Text += (string)temp3.GetValue(i);

                        }
                        else
                        {
                            this.lbLeglAspcts.Text += ";" + (string)temp3.GetValue(i);
                        }
                    }

                    for (int i = 0; i < temp4.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.lbEcoAspcts.Text += (string)temp4.GetValue(i);

                        }
                        else
                        {
                            this.lbEcoAspcts.Text += ";" + (string)temp4.GetValue(i);
                        }
                    }

                    for (int i = 0; i < temp6.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.caseParts += (string)temp6.GetValue(i);

                        }
                        else
                        {
                            this.caseParts += ";" + (string)temp6.GetValue(i);
                        }
                    }

                    temp0 = null;
                    temp1 = null;
                    temp2 = null;
                    temp3 = null;
                    temp4 = null;
                    temp5 = null;
                    temp6 = null;

                    this.setCaseAreaTpTxt();
                    this.setEdctionTpTxt();
                    this.setInstitutionTpTxt();
                    this.setLeglAspctsTpTxt();
                    this.setEcoAspctsTpTxt();
                }
                else
                {
                    if (this.tbCaseNum.Text != string.Empty)
                    {
                        this.lbCaseArea.Text = string.Empty;
                        this.lbEdction.Text = string.Empty;
                        this.lbInstitution.Text = string.Empty;
                        this.lbLeglAspcts.Text = string.Empty;
                        this.lbEcoAspcts.Text = string.Empty;
                        this.lbtitle.Text = string.Empty;

                        MessageBox.Show("Kunne ikke finde sagen med sagsnummer " + this.tbCaseNum.Text + " i databasen " + this.cbSDH.SelectedValue, "Convergens Domino Connector for SDH", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }

                if (this.tbCaseNum.Text.Length == 0 & this.tbCaseNum.Text == string.Empty)
                {
                    this.lbCaseArea.Text = string.Empty;
                    this.lbEdction.Text = string.Empty;
                    this.lbInstitution.Text = string.Empty;
                    this.lbLeglAspcts.Text = string.Empty;
                    this.lbEcoAspcts.Text = string.Empty;
                    this.lbtitle.Text = string.Empty;
                }
            }
            catch (Exception)
            {

                throw;
            }

            #endregion

        }
    }
}
